package ch06.symtab.monolithic;

/**
 * 单作用域类型语言
 * 符号的类
 */
public class Symbol {
    String name;
    Type type;
    public Symbol (String name) {
        this.name = name;
    }

    public Symbol(String name, Type type) {
        this(name);
        this.type = type;
    }

    public String getName(){
        return name;
    }

    public String toString() {
        if (type != null) {
            return "<" + getName() + ":" + type + ">";
        }
        return getName();
    }
}
